# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libx11
pkgver=1.8.1
pkgrel=1
pkgdesc="X11 client-side library"
url="http://xorg.freedesktop.org/"
arch="all"
license="custom:XFREE86"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
depends_dev="libxcb-dev xtrans"
makedepends="$depends_dev xorgproto util-macros xmlto"
source="https://www.x.org/releases/individual/lib/libX11-$pkgver.tar.xz"
builddir="$srcdir"/libX11-$pkgver

# secfixes:
#   1.7.1-r0:
#     - CVE-2021-31535
#   1.6.12-r0:
#     - CVE-2020-14363
#   1.6.10-r0:
#     - CVE-2020-14344
#   1.6.6-r0:
#     - CVE-2018-14598
#     - CVE-2018-14599
#     - CVE-2018-14600

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-xcb \
		--disable-thread-safety-constructor
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

sha512sums="
2e36d2c47519e0cb2697f588c0ccdf73fbe75c2163f0855c78f7052dc9e920bca081f9d5e39c707a14067f101faef74fc758c8862eeba675b1535b43119d533a  libX11-1.8.1.tar.xz
"
